home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-04-09 | 5.1 KB | 200 lines | [TEXT/MPS ] |
- ;
- ; File: Keyboards.a
- ;
- ; Contains: Keyboard API.
- ;
- ; Version: Technology: Keyboard 1.0
- ; Release: QuickTime 3.0
- ;
- ; Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved
- ;
- ; Bugs?: Please include the the file and version information (from above) with
- ; the problem description. Developers belonging to one of the Apple
- ; developer programs can submit bug reports to:
- ;
- ; devsupport@apple.com
- ;
- ;
- IF &TYPE('__KEYBOARDS__') = 'UNDEFINED' THEN
- __KEYBOARDS__ SET 1
-
- IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
- include 'MacTypes.a'
- ENDIF
-
- ; ——————————————————————————————————————————————————————————————————————————————————
- ; Keyboard API constants
- ; ——————————————————————————————————————————————————————————————————————————————————
- ; Keyboard API Trap Number. Should be moved to Traps.i
-
- _KeyboardDispatch EQU $AA7A
- ; Gestalt selector and values for the Keyboard API
-
- gestaltKeyboardsAttr EQU 'kbds'
- gestaltKBPS2Keyboards EQU 1
- gestaltKBPS2SetIDToAny EQU 2
- gestaltKBPS2SetTranslationTable EQU 4
- ; Keyboard API Error Codes
-
- ; I stole the range blow from the empty space in the Allocation project but should
- ; be updated to the officially registered range.
-
-
-
- errKBPS2KeyboardNotAvailable EQU -30850
- errKBIlligalParameters EQU -30851
- errKBFailSettingID EQU -30852
- errKBFailSettingTranslationTable EQU -30853
- errKBFailWritePreference EQU -30854
-
- ; Keyboard HW Layout Types
-
- kKeyboardJIS EQU 'JIS '
- kKeyboardANSI EQU 'ANSI'
- kKeyboardISO EQU 'ISO '
- kKeyboardUnknown EQU $3F3F3F3F
-
- ; ——————————————————————————————————————————————————————————————————————————————————
- ; Keyboard API types
- ; ——————————————————————————————————————————————————————————————————————————————————
-
-
-
- ; ——————————————————————————————————————————————————————————————————————————————————
- ; Keyboard API routines
- ; ——————————————————————————————————————————————————————————————————————————————————
-
- ;
- ; pascal OSErr KBInitialize(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBInitialize
- move.w #$0000,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBInitialize
- ENDIF
-
- ;
- ; pascal OSErr KBSetupPS2Keyboard(short deviceID, char *alternativeTable)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBSetupPS2Keyboard
- move.w #$0001,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBSetupPS2Keyboard
- ENDIF
-
- ;
- ; pascal OSErr KBGetPS2KeyboardID(short *deviceID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBGetPS2KeyboardID
- move.w #$0002,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBGetPS2KeyboardID
- ENDIF
-
- ;
- ; pascal Boolean KBIsPS2KeyboardConnected(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBIsPS2KeyboardConnected
- move.w #$0003,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBIsPS2KeyboardConnected
- ENDIF
-
- ;
- ; pascal Boolean KBIsPS2KeyboardEnabled(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBIsPS2KeyboardEnabled
- move.w #$0004,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBIsPS2KeyboardEnabled
- ENDIF
-
- ;
- ; pascal long KBGetPS2KeyboardAttributes(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBGetPS2KeyboardAttributes
- move.w #$0005,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBGetPS2KeyboardAttributes
- ENDIF
-
- ;
- ; pascal OSErr KBSetKCAPForPS2Keyboard(Handle kcapHandle)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBSetKCAPForPS2Keyboard
- move.w #$0006,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBSetKCAPForPS2Keyboard
- ENDIF
-
- ;
- ; pascal OSType KBGetLayoutType(short deviceID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBGetLayoutType
- move.w #$0007,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBGetLayoutType
- ENDIF
-
- ;
- ; pascal OSErr KBSetupPS2KeyboardFromLayoutType(OSType layoutType)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBSetupPS2KeyboardFromLayoutType
- move.w #$0008,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBSetupPS2KeyboardFromLayoutType
- ENDIF
-
- ;
- ; pascal OSErr KBGetPS2KeyboardLayoutType(OSType *layoutType)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _KBGetPS2KeyboardLayoutType
- move.w #$0009,D0
- dc.w $AA7A
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION KBGetPS2KeyboardLayoutType
- ENDIF
-
-
- ENDIF ; __KEYBOARDS__
-
-